use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};



/// 部门实体，与数据库 `sys_dept` 表的 Schema 完全对应
/// `sqlx::FromRow` 用于从数据库行自动映射
/// `Serialize`, `Deserialize` 用于 API 的 JSON 交互
#[derive(sqlx::FromRow,Default, Debug, Serialize, Deserialize,Clone)]
#[serde(rename_all = "camelCase")]
pub struct AiAgentPlat { 
    pub ai_agent_plat_id: u64,
    pub ai_agent_plat_name: Option<String>,
    pub ai_agent_plat_account_name : Option<String>,
    pub ai_agent_plat_access_token : Option<String>,
    pub ai_agent_plat_access_token_sta : Option<String>,
    pub ai_agent_plat_workspace_name : Option<String>,
    pub ai_agent_plat_workspace_id : Option<String>,
    pub revision : Option<String>,
    pub created_by: Option<String>,
    pub created_time: Option<NaiveDateTime>,
    pub updated_by: Option<String>,
    pub updated_time : Option<NaiveDateTime>,
    #[serde(skip_serializing)]
    pub data_sta : Option<String>, // 数据状态不用返回给前端

}

/// 用于接收前端列表查询的参数
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct ListAiAgentPlatQuery {
    pub ai_agent_plat_name: Option<String>,
    pub ai_agent_plat_account_name : Option<String>,
    #[serde(rename = "params[beginTime]")]
    pub begin_time: Option<String>,
    #[serde(rename = "params[endTime]")]
    pub end_time: Option<String>,
    pub page_num: Option<u64>,
    pub page_size: Option<u64>,
}

/// 用于接收前端“新增”请求的数据体
#[derive(Deserialize, Debug,Clone)]
#[serde(rename_all = "camelCase")]
pub struct AddAiAgentPlatVo {
    pub ai_agent_plat_name: Option<String>,
    pub ai_agent_plat_account_name : Option<String>,
    pub ai_agent_plat_access_token : Option<String>,
    pub ai_agent_plat_workspace_name : Option<String>,
    pub ai_agent_plat_workspace_id : Option<String>,
}

/// 用于接收前端“修改”请求的数据体
#[derive(Deserialize, Debug,Clone)]
#[serde(rename_all = "camelCase")]
pub struct UpdateAiAgentPlatVo {
    pub ai_agent_plat_id: u64,
    pub ai_agent_plat_name: Option<String>,
    pub ai_agent_plat_account_name : Option<String>,
    pub ai_agent_plat_access_token : Option<String>,
    pub ai_agent_plat_workspace_name : Option<String>,
    pub ai_agent_plat_workspace_id : Option<String>,
}